package com.speed_run.service.thirdLogin;

import com.speed_run.utils.JwtUtils;
import lombok.extern.log4j.Log4j2;
import org.apache.shiro.authc.ExpiredCredentialsException;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@Log4j2
public class WeichatLoginServiceImpl  extends GeneralLoginService implements IThirdLoginService {


	/**
	 * 处理微信登录，如果token过期的话，从新获取
	 * @param subject
	 * @param token
	 */
	@Override
	public void login(Subject subject,UsernamePasswordToken token) {
		try{

			this.userLogin(subject,token);

		} catch (ExpiredCredentialsException e){

		}
		catch (RuntimeException e){
			//log.error(e);
			throw e;
		}

	}
}
